<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>容器镜像安全分析报告</title>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <style>
        :root {
            --primary: #4361ee;
            --secondary: #3f37c9;
            --success: #4cc9f0;
            --danger: #f72585;
            --warning: #f8961e;
            --info: #4895ef;
            --light: #f8f9fa;
            --dark: #212529;
            --gray: #6c757d;
        }

        body {
            font-family: 'Inter', sans-serif;
            line-height: 1.6;
            color: var(--dark);
            background-color: #f5f7fa;
            margin: 0;
            padding: 20px;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
        }

        .header {
            text-align: center;
            margin-bottom: 30px;
            padding-bottom: 20px;
            border-bottom: 1px solid #e0e0e0;
        }

        .header h1 {
            color: var(--primary);
            margin-bottom: 10px;
        }

        .header p {
            color: var(--gray);
            margin-top: 0;
        }

        .card {
            background: white;
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
            margin-bottom: 25px;
            overflow: hidden;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        }

        .card-header {
            padding: 15px 20px;
            background-color: var(--primary);
            color: white;
            font-weight: 500;
        }

        .card-body {
            padding: 20px;
        }

        .image-list {
            list-style-type: none;
            padding: 0;
            margin: 0;
        }

        .image-list li {
            padding: 12px 15px;
            border-bottom: 1px solid #eee;
            display: flex;
            align-items: center;
        }

        .image-list li:last-child {
            border-bottom: none;
        }

        .image-list li:before {
            content: "•";
            color: var(--primary);
            font-weight: bold;
            display: inline-block;
            width: 1em;
            margin-right: 10px;
        }

        .chart-container {
            position: relative;
            height: 300px;
            margin-top: 20px;
        }

        .stats-container {
            display: flex;
            gap: 15px;
        }

        .stat-item {
            flex: 1;
            text-align: center;
            padding: 15px;
            background: var(--light);
            border-radius: 8px;
        }

        .stat-value {
            font-size: 24px;
            font-weight: 600;
            color: var(--primary);
            margin: 10px 0;
        }

        .stat-name {
            color: var(--gray);
            font-size: 14px;
        }

        .tag-item {
            margin-bottom: 15px;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 8px;
            border-left: 4px solid var(--primary);
        }

        .tag-image {
            font-weight: 500;
            margin-bottom: 8px;
            color: var(--secondary);
        }

        .tag-content {
            font-size: 14px;
            color: var(--gray);
            word-break: break-all;
        }

        .badge {
            display: inline-block;
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: 500;
        }

        .badge-danger {
            background-color: var(--danger);
            color: white;
        }

        .badge-warning {
            background-color: var(--warning);
            color: white;
        }

        .badge-success {
            background-color: var(--success);
            color: white;
        }

        .badge-info {
            background-color: var(--info);
            color: white;
        }

        .badge-light {
            background-color: var(--light);
            color: var(--dark);
        }

        @media (max-width: 768px) {
            .stats-container {
                flex-direction: column;
            }
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="header">
            <h1>容器镜像安全分析报告</h1>
            <p>最新扫描时间: <span id="scan-time"></span></p>
        </div>

        <div class="card">
            <div class="card-header">资产信息</div>
            <div class="card-body">
                <ul class="image-list">
                    <li>acgpiano/sqli-labs:latest</li>
                    <li>centos:latest</li>
                    <li>nginx:alpine</li>
                    <li>nginx:latest</li>
                    <li>postgres:latest</li>
                    <li>subfuzion/netcat:latest</li>
                </ul>
            </div>
        </div>

        <div class="card">
            <div class="card-header">告警与安全状态</div>
            <div class="card-body">
                <div class="stats-container">
                    <div class="stat-item">
                        <div class="stat-name">存在漏洞</div>
                        <div class="stat-value">1</div>
                        <span class="badge badge-danger">高风险</span>
                    </div>
                    <div class="stat-item">
                        <div class="stat-name">未扫描</div>
                        <div class="stat-value">5</div>
                        <span class="badge badge-warning">需关注</span>
                    </div>
                    <div class="stat-item">
                        <div class="stat-name">安全等级</div>
                        <div class="stat-value">2/10</div>
                        <span class="badge badge-danger">低</span>
                    </div>
                </div>

                <div class="chart-container">
                    <canvas id="vulnerabilityChart"></canvas>
                </div>

                <div style="margin-top: 30px;">
                    <h3 style="margin-bottom: 15px; color: var(--dark);">其他扫描状态</h3>
                    <div style="display: flex; flex-wrap: wrap; gap: 10px;">
                        <span class="badge badge-light">病毒扫描: 未扫描</span>
                        <span class="badge badge-light">Webshell 扫描: 未扫描</span>
                        <span class="badge badge-light">敏感信息扫描: 未扫描</span>
                        <span class="badge badge-light">许可证扫描: 未扫描</span>
                    </div>
                </div>
            </div>
        </div>

        <div class="card">
            <div class="card-header">统计数据</div>
            <div class="card-body">
                <div class="chart-container">
                    <canvas id="statsChart"></canvas>
                </div>
            </div>
        </div>

        <div class="card">
            <div class="card-header">标签信息</div>
            <div class="card-body">
                <div class="tag-item">
                    <div class="tag-image">acgpiano/sqli-labs:latest</div>
                    <div class="tag-content">e30=</div>
                </div>
                <div class="tag-item">
                    <div class="tag-image">centos:latest</div>
                    <div class="tag-content">包含基础镜像信息（Base64 编码）</div>
                </div>
                <div class="tag-item">
                    <div class="tag-image">nginx:alpine</div>
                    <div class="tag-content">包含管理员信息（Base64 编码）</div>
                </div>
                <div class="tag-item">
                    <div class="tag-image">nginx:latest</div>
                    <div class="tag-content">包含管理员信息（Base64 编码）</div>
                </div>
                <div class="tag-item">
                    <div class="tag-image">postgres:latest</div>
                    <div class="tag-content">
                        eyJtYWludGFpbmVyIjoiTkdJTlggRG9ja2VyIE1haW50YWluZXJzIFx1MDAzY2RvY2tlci1tYWludEBuZ2lueC5jb21cdTAwM2UifQ==
                    </div>
                </div>
                <div class="tag-item">
                    <div class="tag-image">subfuzion/netcat:latest</div>
                    <div class="tag-content">e30=</div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // 设置扫描时间
        document.getElementById('scan-time').textContent = new Date().toLocaleString();

        // 漏洞图表
        const vulnCtx = document.getElementById('vulnerabilityChart').getContext('2d');
        const vulnerabilityChart = new Chart(vulnCtx, {
            type: 'bar',
            data: {
                labels: ['存在漏洞', '未扫描'],
                datasets: [{
                    label: '漏洞扫描状态',
                    data: [1, 5],
                    backgroundColor: [
                        'rgba(247, 37, 133, 0.7)',
                        'rgba(248, 150, 30, 0.7)'
                    ],
                    borderColor: [
                        'rgba(247, 37, 133, 1)',
                        'rgba(248, 150, 30, 1)'
                    ],
                    borderWidth: 1
                }]
            },
            options: {
                responsive: true,
                maintainAspectRatio: false,
                scales: {
                    y: {
                        beginAtZero: true,
                        ticks: {
                            stepSize: 1
                        }
                    }
                },
                plugins: {
                    legend: {
                        display: false
                    }
                }
            }
        });

        // 统计数据图表
        const statsCtx = document.getElementById('statsChart').getContext('2d');
        const statsChart = new Chart(statsCtx, {
            type: 'bar',
            data: {
                labels: ['关联容器数量', '容器总数'],
                datasets: [{
                    label: '数量',
                    data: [5, 4],
                    backgroundColor: [
                        'rgba(67, 97, 238, 0.7)',
                        'rgba(72, 149, 239, 0.7)'
                    ],
                    borderColor: [
                        'rgba(67, 97, 238, 1)',
                        'rgba(72, 149, 239, 1)'
                    ],
                    borderWidth: 1
                }]
            },
            options: {
                responsive: true,
                maintainAspectRatio: false,
                scales: {
                    y: {
                        beginAtZero: true,
                        ticks: {
                            stepSize: 1
                        }
                    }
                },
                plugins: {
                    legend: {
                        display: false
                    }
                }
            }
        });
    </script>
</body>

</html>